package com.sven.idrivingfutureserver.common;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@NoArgsConstructor
@ToString
public class Response {

    private boolean success = true;
    private int code = 10000; //默认值
    private String message;

    public Response(ResultCode resultCode) {
        this.success = resultCode.success();
        this.code = resultCode.code();
        this.message = resultCode.message();
    }

    public static Response SUCCESS() {
        return new Response(CommonCode.SUCCESS);
    }

    public static Response FAIL() {
        return new Response(CommonCode.FAIL);
    }


}
